1
2 -- --------------------------------------------------
3 -- Entity Designer DDL Script for SQL Server 2005, 2008, 2012 and Azure
4 -- --------------------------------------------------
5 -- Date Created: 10/19/2019 23:52:22
6 -- Generated from EDMX file: C:\Users\Admin\Desktop\Future\Models\FutureModel.edmx
7 -- --------------------------------------------------
8
9 SET QUOTED_IDENTIFIER OFF;
10 GO
11 USE [Future];
12 GO
13 IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
14 GO
15
16 -- --------------------------------------------------
17 -- Dropping existing FOREIGN KEY constraints
18 -- --------------------------------------------------
19
20 IF OBJECT_ID(N'[dbo].[FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId]', 'F') IS NOT NULL
21 ALTER TABLE [dbo].[AspNetUserClaims] DROP CONSTRAINT [FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId];
22 GO
23 IF OBJECT_ID(N'[dbo].[FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId]', 'F') IS NOT NULL
24 ALTER TABLE [dbo].[AspNetUserLogins] DROP CONSTRAINT [FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId];
25 GO
26 IF OBJECT_ID(N'[dbo].[FK_dbo_AspNetUserRoles_dbo_AspNetRoles_RoleId]', 'F') IS NOT NULL
27 ALTER TABLE [dbo].[AspNetUserRoles] DROP CONSTRAINT [FK_dbo_AspNetUserRoles_dbo_AspNetRoles_RoleId];
28 GO
29 IF OBJECT_ID(N'[dbo].[FK_dbo_AspNetUserRoles_dbo_AspNetUsers_UserId]', 'F') IS NOT NULL
30 ALTER TABLE [dbo].[AspNetUserRoles] DROP CONSTRAINT [FK_dbo_AspNetUserRoles_dbo_AspNetUsers_UserId];
31 GO
32
33 -- --------------------------------------------------
34 -- Dropping existing tables
35 -- --------------------------------------------------
36
37 IF OBJECT_ID(N'[dbo].[__MigrationHistory]', 'U') IS NOT NULL
38 DROP TABLE [dbo].[__MigrationHistory];
39 GO
40 IF OBJECT_ID(N'[dbo].[AspNetRoles]', 'U') IS NOT NULL
41 DROP TABLE [dbo].[AspNetRoles];
42 GO
43 IF OBJECT_ID(N'[dbo].[AspNetUserClaims]', 'U') IS NOT NULL
44 DROP TABLE [dbo].[AspNetUserClaims];
45 GO
46 IF OBJECT_ID(N'[dbo].[AspNetUserLogins]', 'U') IS NOT NULL
47 DROP TABLE [dbo].[AspNetUserLogins];
48 GO
49 IF OBJECT_ID(N'[dbo].[AspNetUserRoles]', 'U') IS NOT NULL
50 DROP TABLE [dbo].[AspNetUserRoles];
51 GO
52 IF OBJECT_ID(N'[dbo].[AspNetUsers]', 'U') IS NOT NULL
53 DROP TABLE [dbo].[AspNetUsers];
54 GO
55 IF OBJECT_ID(N'[FutureModelStoreContainer].[HoatDongs]', 'U') IS NOT NULL
56 DROP TABLE [FutureModelStoreContainer].[HoatDongs];
57 GO
58 IF OBJECT_ID(N'[FutureModelStoreContainer].[Thes]', 'U') IS NOT NULL
59 DROP TABLE [FutureModelStoreContainer].[Thes];
60 GO
61
62 -- --------------------------------------------------
63 -- Creating all tables
64 -- --------------------------------------------------
65
66 -- Creating table 'C__MigrationHistory'
67 CREATE TABLE [dbo].[C__MigrationHistory] (
68 [MigrationId] nvarchar(150) NOT NULL,
69 [ContextKey] nvarchar(300) NOT NULL,
70 [Model] varbinary(max) NOT NULL,
71 [ProductVersion] nvarchar(32) NOT NULL
72 );
73 GO
74
75 -- Creating table 'AspNetRoles'
76 CREATE TABLE [dbo].[AspNetRoles] (
77 [Id] nvarchar(128) NOT NULL,
78 [Name] nvarchar(256) NOT NULL
79 );
80 GO
81
82 -- Creating table 'AspNetUserClaims'
83 CREATE TABLE [dbo].[AspNetUserClaims] (
84 [Id] int IDENTITY(1,1) NOT NULL,
85 [UserId] nvarchar(128) NOT NULL,
86 [ClaimType] nvarchar(max) NULL,
87 [ClaimValue] nvarchar(max) NULL
88 );
89 GO
90
91 -- Creating table 'AspNetUserLogins'
92 CREATE TABLE [dbo].[AspNetUserLogins] (
93 [LoginProvider] nvarchar(128) NOT NULL,
94 [ProviderKey] nvarchar(128) NOT NULL,
95 [UserId] nvarchar(128) NOT NULL
96 );
97 GO
98
99 -- Creating table 'AspNetUsers'
100 CREATE TABLE [dbo].[AspNetUsers] (
101 [Id] nvarchar(128) NOT NULL,
102 [MaGioiThieu] nvarchar(max) DEFAULT '00000' NOT NULL,
103 [Pasup] bit DEFAULT 0 NOT NULL,
104 [Blance] float DEFAULT 0 NOT NULL,
105 [HoaHong] float DEFAULT 0 NOT NULL,
106 [Maxout] float DEFAULT 0 NOT NULL,
107 [Email] nvarchar(256) NULL,
108 [EmailConfirmed] bit NOT NULL,
109 [PasswordHash] nvarchar(max) NULL,
110 [Password_2] nvarchar(max) NULL,
111 [SecurityStamp] nvarchar(max) NULL,
112 [PhoneNumber] nvarchar(max) NULL,
113 [PhoneNumberConfirmed] bit DEFAULT 1 NOT NULL,
114 [TwoFactorEnabled] bit NOT NULL,
115 [LockoutEndDateUtc] datetime NULL,
116 [LockoutEnabled] bit NOT NULL,
117 [AccessFailedCount] int NOT NULL,
118 [UserName] nvarchar(256) NOT NULL,
119 [NganHang] nvarchar(256) NULL,
120 [SoTaiKhoan] nvarchar(256) NULL,
121 [ChuKhoan] nvarchar(256) NULL
122
123 );
124 GO
125
126 -- Creating table 'HoatDongs'
127 CREATE TABLE [dbo].[HoatDongs] (
128 [Id] int IDENTITY(1,1) NOT NULL,
129 [TaiKhoanChuyen] nvarchar(max) NOT NULL,
130 [TaiKhoanNhan] nvarchar(max) NOT NULL,
131 [Loai] nvarchar(max) NOT NULL,
132 [NoiDung] nvarchar(max) NOT NULL,
133 [TrangThai] bit DEFAULT 0 NOT NULL,
134 [SoTien] float DEFAULT 0 NOT NULL,
135 [ThoiGian] datetime DEFAULT GETDATE() NOT NULL,
136 PRIMARY KEY (Id)
137 );
138 GO
139
140 -- Creating table 'Thes'
141 CREATE TABLE [dbo].[Thes] (
142 [Id] int IDENTITY(1,1) NOT NULL,
143 [Code] nvarchar(max) NOT NULL,
144 [SoHuu] nvarchar(128) DEFAULT '0' NOT NULL,
145 [TrangThai] bit DEFAULT 0 NOT NULL,
146 PRIMARY KEY (Id)
147 );
148 GO
149
150 -- Creating table 'AspNetUserRoles'
151 CREATE TABLE [dbo].[AspNetUserRoles] (
152 [AspNetRoles_Id] nvarchar(128) NOT NULL,
153 [AspNetUsers_Id] nvarchar(128) NOT NULL
154 );
155 GO
156
157 -- --------------------------------------------------
158 -- Creating all PRIMARY KEY constraints
159 -- --------------------------------------------------
160
161 -- Creating primary key on [MigrationId], [ContextKey] in table 'C__MigrationHistory'
162 ALTER TABLE [dbo].[C__MigrationHistory]
163 ADD CONSTRAINT [PK_C__MigrationHistory]
164 PRIMARY KEY CLUSTERED ([MigrationId], [ContextKey] ASC);
165 GO
166
167 -- Creating primary key on [Id] in table 'AspNetRoles'
168 ALTER TABLE [dbo].[AspNetRoles]
169 ADD CONSTRAINT [PK_AspNetRoles]
170 PRIMARY KEY CLUSTERED ([Id] ASC);
171 GO
172
173 -- Creating primary key on [Id] in table 'AspNetUserClaims'
174 ALTER TABLE [dbo].[AspNetUserClaims]
175 ADD CONSTRAINT [PK_AspNetUserClaims]
176 PRIMARY KEY CLUSTERED ([Id] ASC);
177 GO
178
179 -- Creating primary key on [LoginProvider], [ProviderKey], [UserId] in table 'AspNetUserLogins'
180 ALTER TABLE [dbo].[AspNetUserLogins]
181 ADD CONSTRAINT [PK_AspNetUserLogins]
182 PRIMARY KEY CLUSTERED ([LoginProvider], [ProviderKey], [UserId] ASC);
183 GO
184
185 -- Creating primary key on [Id] in table 'AspNetUsers'
186 ALTER TABLE [dbo].[AspNetUsers]
187 ADD CONSTRAINT [PK_AspNetUsers]
188 PRIMARY KEY CLUSTERED ([Id] ASC);
189 GO
190
191 -- Creating primary key on [Id] in table 'HoatDongs'
192 ALTER TABLE [dbo].[HoatDongs]
193 ADD CONSTRAINT [PK_HoatDongs]
194 PRIMARY KEY CLUSTERED ([Id] ASC);
195 GO
196
197 -- Creating primary key on [Id], [SoHuu], [TrangThai] in table 'Thes'
198 ALTER TABLE [dbo].[Thes]
199 ADD CONSTRAINT [PK_Thes]
200 PRIMARY KEY CLUSTERED ([Id], [SoHuu], [TrangThai] ASC);
201 GO
202
203 -- Creating primary key on [AspNetRoles_Id], [AspNetUsers_Id] in table 'AspNetUserRoles'
204 ALTER TABLE [dbo].[AspNetUserRoles]
205 ADD CONSTRAINT [PK_AspNetUserRoles]
206 PRIMARY KEY CLUSTERED ([AspNetRoles_Id], [AspNetUsers_Id] ASC);
207 GO
208
209 -- --------------------------------------------------
210 -- Creating all FOREIGN KEY constraints
211 -- --------------------------------------------------
212
213 -- Creating foreign key on [UserId] in table 'AspNetUserClaims'
214 ALTER TABLE [dbo].[AspNetUserClaims]
215 ADD CONSTRAINT [FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId]
216 FOREIGN KEY ([UserId])
217 REFERENCES [dbo].[AspNetUsers]
218 ([Id])
219 ON DELETE CASCADE ON UPDATE NO ACTION;
220 GO
221
222 -- Creating non-clustered index for FOREIGN KEY 'FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId'
223 CREATE INDEX [IX_FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId]
224 ON [dbo].[AspNetUserClaims]
225 ([UserId]);
226 GO
227
228 -- Creating foreign key on [UserId] in table 'AspNetUserLogins'
229 ALTER TABLE [dbo].[AspNetUserLogins]
230 ADD CONSTRAINT [FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId]
231 FOREIGN KEY ([UserId])
232 REFERENCES [dbo].[AspNetUsers]
233 ([Id])
234 ON DELETE CASCADE ON UPDATE NO ACTION;
235 GO
236
237 -- Creating non-clustered index for FOREIGN KEY 'FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId'
238 CREATE INDEX [IX_FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId]
239 ON [dbo].[AspNetUserLogins]
240 ([UserId]);
241 GO
242
243 -- Creating foreign key on [AspNetRoles_Id] in table 'AspNetUserRoles'
244 ALTER TABLE [dbo].[AspNetUserRoles]
245 ADD CONSTRAINT [FK_AspNetUserRoles_AspNetRoles]
246 FOREIGN KEY ([AspNetRoles_Id])
247 REFERENCES [dbo].[AspNetRoles]
248 ([Id])
249 ON DELETE NO ACTION ON UPDATE NO ACTION;
250 GO
251
252 -- Creating foreign key on [AspNetUsers_Id] in table 'AspNetUserRoles'
253 ALTER TABLE [dbo].[AspNetUserRoles]
254 ADD CONSTRAINT [FK_AspNetUserRoles_AspNetUsers]
255 FOREIGN KEY ([AspNetUsers_Id])
256 REFERENCES [dbo].[AspNetUsers]
257 ([Id])
258 ON DELETE NO ACTION ON UPDATE NO ACTION;
259 GO
260
261 -- Creating non-clustered index for FOREIGN KEY 'FK_AspNetUserRoles_AspNetUsers'
262 CREATE INDEX [IX_FK_AspNetUserRoles_AspNetUsers]
263 ON [dbo].[AspNetUserRoles]
264 ([AspNetUsers_Id]);
265 GO
266
267 -- --------------------------------------------------
268 -- Script has ended
269 -- --------------------------------------------------
2 -- --------------------------------------------------
3 -- Entity Designer DDL Script for SQL Server 2005, 2008, 2012 and Azure
4 -- --------------------------------------------------
5 -- Date Created: 10/19/2019 23:52:22
6 -- Generated from EDMX file: C:\Users\Admin\Desktop\Future\Models\FutureModel.edmx
7 -- --------------------------------------------------
8
9 SET QUOTED_IDENTIFIER OFF;
10 GO
11 USE [Future];
12 GO
13 IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
14 GO
15
16 -- --------------------------------------------------
17 -- Dropping existing FOREIGN KEY constraints
18 -- --------------------------------------------------
19
20 IF OBJECT_ID(N'[dbo].[FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId]', 'F') IS NOT NULL
21 ALTER TABLE [dbo].[AspNetUserClaims] DROP CONSTRAINT [FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId];
22 GO
23 IF OBJECT_ID(N'[dbo].[FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId]', 'F') IS NOT NULL
24 ALTER TABLE [dbo].[AspNetUserLogins] DROP CONSTRAINT [FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId];
25 GO
26 IF OBJECT_ID(N'[dbo].[FK_dbo_AspNetUserRoles_dbo_AspNetRoles_RoleId]', 'F') IS NOT NULL
27 ALTER TABLE [dbo].[AspNetUserRoles] DROP CONSTRAINT [FK_dbo_AspNetUserRoles_dbo_AspNetRoles_RoleId];
28 GO
29 IF OBJECT_ID(N'[dbo].[FK_dbo_AspNetUserRoles_dbo_AspNetUsers_UserId]', 'F') IS NOT NULL
30 ALTER TABLE [dbo].[AspNetUserRoles] DROP CONSTRAINT [FK_dbo_AspNetUserRoles_dbo_AspNetUsers_UserId];
31 GO
32
33 -- --------------------------------------------------
34 -- Dropping existing tables
35 -- --------------------------------------------------
36
37 IF OBJECT_ID(N'[dbo].[__MigrationHistory]', 'U') IS NOT NULL
38 DROP TABLE [dbo].[__MigrationHistory];
39 GO
40 IF OBJECT_ID(N'[dbo].[AspNetRoles]', 'U') IS NOT NULL
41 DROP TABLE [dbo].[AspNetRoles];
42 GO
43 IF OBJECT_ID(N'[dbo].[AspNetUserClaims]', 'U') IS NOT NULL
44 DROP TABLE [dbo].[AspNetUserClaims];
45 GO
46 IF OBJECT_ID(N'[dbo].[AspNetUserLogins]', 'U') IS NOT NULL
47 DROP TABLE [dbo].[AspNetUserLogins];
48 GO
49 IF OBJECT_ID(N'[dbo].[AspNetUserRoles]', 'U') IS NOT NULL
50 DROP TABLE [dbo].[AspNetUserRoles];
51 GO
52 IF OBJECT_ID(N'[dbo].[AspNetUsers]', 'U') IS NOT NULL
53 DROP TABLE [dbo].[AspNetUsers];
54 GO
55 IF OBJECT_ID(N'[FutureModelStoreContainer].[HoatDongs]', 'U') IS NOT NULL
56 DROP TABLE [FutureModelStoreContainer].[HoatDongs];
57 GO
58 IF OBJECT_ID(N'[FutureModelStoreContainer].[Thes]', 'U') IS NOT NULL
59 DROP TABLE [FutureModelStoreContainer].[Thes];
60 GO
61
62 -- --------------------------------------------------
63 -- Creating all tables
64 -- --------------------------------------------------
65
66 -- Creating table 'C__MigrationHistory'
67 CREATE TABLE [dbo].[C__MigrationHistory] (
68 [MigrationId] nvarchar(150) NOT NULL,
69 [ContextKey] nvarchar(300) NOT NULL,
70 [Model] varbinary(max) NOT NULL,
71 [ProductVersion] nvarchar(32) NOT NULL
72 );
73 GO
74
75 -- Creating table 'AspNetRoles'
76 CREATE TABLE [dbo].[AspNetRoles] (
77 [Id] nvarchar(128) NOT NULL,
78 [Name] nvarchar(256) NOT NULL
79 );
80 GO
81
82 -- Creating table 'AspNetUserClaims'
83 CREATE TABLE [dbo].[AspNetUserClaims] (
84 [Id] int IDENTITY(1,1) NOT NULL,
85 [UserId] nvarchar(128) NOT NULL,
86 [ClaimType] nvarchar(max) NULL,
87 [ClaimValue] nvarchar(max) NULL
88 );
89 GO
90
91 -- Creating table 'AspNetUserLogins'
92 CREATE TABLE [dbo].[AspNetUserLogins] (
93 [LoginProvider] nvarchar(128) NOT NULL,
94 [ProviderKey] nvarchar(128) NOT NULL,
95 [UserId] nvarchar(128) NOT NULL
96 );
97 GO
98
99 -- Creating table 'AspNetUsers'
100 CREATE TABLE [dbo].[AspNetUsers] (
101 [Id] nvarchar(128) NOT NULL,
102 [MaGioiThieu] nvarchar(max) DEFAULT '00000' NOT NULL,
103 [Pasup] bit DEFAULT 0 NOT NULL,
104 [Blance] float DEFAULT 0 NOT NULL,
105 [HoaHong] float DEFAULT 0 NOT NULL,
106 [Maxout] float DEFAULT 0 NOT NULL,
107 [Email] nvarchar(256) NULL,
108 [EmailConfirmed] bit NOT NULL,
109 [PasswordHash] nvarchar(max) NULL,
110 [Password_2] nvarchar(max) NULL,
111 [SecurityStamp] nvarchar(max) NULL,
112 [PhoneNumber] nvarchar(max) NULL,
113 [PhoneNumberConfirmed] bit DEFAULT 1 NOT NULL,
114 [TwoFactorEnabled] bit NOT NULL,
115 [LockoutEndDateUtc] datetime NULL,
116 [LockoutEnabled] bit NOT NULL,
117 [AccessFailedCount] int NOT NULL,
118 [UserName] nvarchar(256) NOT NULL,
119 [NganHang] nvarchar(256) NULL,
120 [SoTaiKhoan] nvarchar(256) NULL,
121 [ChuKhoan] nvarchar(256) NULL
122
123 );
124 GO
125
126 -- Creating table 'HoatDongs'
127 CREATE TABLE [dbo].[HoatDongs] (
128 [Id] int IDENTITY(1,1) NOT NULL,
129 [TaiKhoanChuyen] nvarchar(max) NOT NULL,
130 [TaiKhoanNhan] nvarchar(max) NOT NULL,
131 [Loai] nvarchar(max) NOT NULL,
132 [NoiDung] nvarchar(max) NOT NULL,
133 [TrangThai] bit DEFAULT 0 NOT NULL,
134 [SoTien] float DEFAULT 0 NOT NULL,
135 [ThoiGian] datetime DEFAULT GETDATE() NOT NULL,
136 PRIMARY KEY (Id)
137 );
138 GO
139
140 -- Creating table 'Thes'
141 CREATE TABLE [dbo].[Thes] (
142 [Id] int IDENTITY(1,1) NOT NULL,
143 [Code] nvarchar(max) NOT NULL,
144 [SoHuu] nvarchar(128) DEFAULT '0' NOT NULL,
145 [TrangThai] bit DEFAULT 0 NOT NULL,
146 PRIMARY KEY (Id)
147 );
148 GO
149
150 -- Creating table 'AspNetUserRoles'
151 CREATE TABLE [dbo].[AspNetUserRoles] (
152 [AspNetRoles_Id] nvarchar(128) NOT NULL,
153 [AspNetUsers_Id] nvarchar(128) NOT NULL
154 );
155 GO
156
157 -- --------------------------------------------------
158 -- Creating all PRIMARY KEY constraints
159 -- --------------------------------------------------
160
161 -- Creating primary key on [MigrationId], [ContextKey] in table 'C__MigrationHistory'
162 ALTER TABLE [dbo].[C__MigrationHistory]
163 ADD CONSTRAINT [PK_C__MigrationHistory]
164 PRIMARY KEY CLUSTERED ([MigrationId], [ContextKey] ASC);
165 GO
166
167 -- Creating primary key on [Id] in table 'AspNetRoles'
168 ALTER TABLE [dbo].[AspNetRoles]
169 ADD CONSTRAINT [PK_AspNetRoles]
170 PRIMARY KEY CLUSTERED ([Id] ASC);
171 GO
172
173 -- Creating primary key on [Id] in table 'AspNetUserClaims'
174 ALTER TABLE [dbo].[AspNetUserClaims]
175 ADD CONSTRAINT [PK_AspNetUserClaims]
176 PRIMARY KEY CLUSTERED ([Id] ASC);
177 GO
178
179 -- Creating primary key on [LoginProvider], [ProviderKey], [UserId] in table 'AspNetUserLogins'
180 ALTER TABLE [dbo].[AspNetUserLogins]
181 ADD CONSTRAINT [PK_AspNetUserLogins]
182 PRIMARY KEY CLUSTERED ([LoginProvider], [ProviderKey], [UserId] ASC);
183 GO
184
185 -- Creating primary key on [Id] in table 'AspNetUsers'
186 ALTER TABLE [dbo].[AspNetUsers]
187 ADD CONSTRAINT [PK_AspNetUsers]
188 PRIMARY KEY CLUSTERED ([Id] ASC);
189 GO
190
191 -- Creating primary key on [Id] in table 'HoatDongs'
192 ALTER TABLE [dbo].[HoatDongs]
193 ADD CONSTRAINT [PK_HoatDongs]
194 PRIMARY KEY CLUSTERED ([Id] ASC);
195 GO
196
197 -- Creating primary key on [Id], [SoHuu], [TrangThai] in table 'Thes'
198 ALTER TABLE [dbo].[Thes]
199 ADD CONSTRAINT [PK_Thes]
200 PRIMARY KEY CLUSTERED ([Id], [SoHuu], [TrangThai] ASC);
201 GO
202
203 -- Creating primary key on [AspNetRoles_Id], [AspNetUsers_Id] in table 'AspNetUserRoles'
204 ALTER TABLE [dbo].[AspNetUserRoles]
205 ADD CONSTRAINT [PK_AspNetUserRoles]
206 PRIMARY KEY CLUSTERED ([AspNetRoles_Id], [AspNetUsers_Id] ASC);
207 GO
208
209 -- --------------------------------------------------
210 -- Creating all FOREIGN KEY constraints
211 -- --------------------------------------------------
212
213 -- Creating foreign key on [UserId] in table 'AspNetUserClaims'
214 ALTER TABLE [dbo].[AspNetUserClaims]
215 ADD CONSTRAINT [FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId]
216 FOREIGN KEY ([UserId])
217 REFERENCES [dbo].[AspNetUsers]
218 ([Id])
219 ON DELETE CASCADE ON UPDATE NO ACTION;
220 GO
221
222 -- Creating non-clustered index for FOREIGN KEY 'FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId'
223 CREATE INDEX [IX_FK_dbo_AspNetUserClaims_dbo_AspNetUsers_UserId]
224 ON [dbo].[AspNetUserClaims]
225 ([UserId]);
226 GO
227
228 -- Creating foreign key on [UserId] in table 'AspNetUserLogins'
229 ALTER TABLE [dbo].[AspNetUserLogins]
230 ADD CONSTRAINT [FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId]
231 FOREIGN KEY ([UserId])
232 REFERENCES [dbo].[AspNetUsers]
233 ([Id])
234 ON DELETE CASCADE ON UPDATE NO ACTION;
235 GO
236
237 -- Creating non-clustered index for FOREIGN KEY 'FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId'
238 CREATE INDEX [IX_FK_dbo_AspNetUserLogins_dbo_AspNetUsers_UserId]
239 ON [dbo].[AspNetUserLogins]
240 ([UserId]);
241 GO
242
243 -- Creating foreign key on [AspNetRoles_Id] in table 'AspNetUserRoles'
244 ALTER TABLE [dbo].[AspNetUserRoles]
245 ADD CONSTRAINT [FK_AspNetUserRoles_AspNetRoles]
246 FOREIGN KEY ([AspNetRoles_Id])
247 REFERENCES [dbo].[AspNetRoles]
248 ([Id])
249 ON DELETE NO ACTION ON UPDATE NO ACTION;
250 GO
251
252 -- Creating foreign key on [AspNetUsers_Id] in table 'AspNetUserRoles'
253 ALTER TABLE [dbo].[AspNetUserRoles]
254 ADD CONSTRAINT [FK_AspNetUserRoles_AspNetUsers]
255 FOREIGN KEY ([AspNetUsers_Id])
256 REFERENCES [dbo].[AspNetUsers]
257 ([Id])
258 ON DELETE NO ACTION ON UPDATE NO ACTION;
259 GO
260
261 -- Creating non-clustered index for FOREIGN KEY 'FK_AspNetUserRoles_AspNetUsers'
262 CREATE INDEX [IX_FK_AspNetUserRoles_AspNetUsers]
263 ON [dbo].[AspNetUserRoles]
264 ([AspNetUsers_Id]);
265 GO
266
267 -- --------------------------------------------------
268 -- Script has ended
269 -- --------------------------------------------------